#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
void reverse(char* start, char* end)
{
    char* left = start;
    char* right = end;
    while (left < right)
    {
        char tmp = *left;
        *left = *right;
        *right = tmp;
        left++;
        right--;
    }
}
int main()
{
    char arr[101] = { 0 };
    scanf("%[^\n]", arr);
    int len = strlen(arr);
    char* str = arr;
    while (*str)
    {
        char* start = str;
        char* end = str;
        while (*end != ' ' && *end != '\0')
        {
            end++;
        }
        if (*end != '\0')
        {
            reverse(start, end - 1);
            str = end + 1;
        }
        else
        {
            reverse(start, end - 1);
            str = end;
        }
    }
    reverse(arr, arr + len - 1);
    printf("%s\n", arr);
    return 0;
}